﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Reflection;
using IDAL;

namespace DALFactory
{
    public class VideoDALFactory
    {
        public static IVideoDAL CreatInstance(String configKey)
        {
            String className = ConfigurationManager.AppSettings[configKey];
            return (IVideoDAL)Assembly.Load("SQLServerDAL").CreateInstance(className);    // 此处参数直接传字符串（数据库访问类名称）
            // return (IVideoDAL)Assembly.Load("SQLServerDAL").CreateInstance("VideoDAL");
        }
    }
}
